package com.trhui.mallbook.client;

import com.trhui.mallbook.domain.common.ApiRequest;
import com.trhui.mallbook.domain.common.BaseResponse;
import com.trhui.mallbook.domain.request.dg.QueryOrderSummaryRequest;
import com.trhui.mallbook.domain.response.dg.QueryOrderSummaryResponse;
import com.trhui.mallbook.enums.ChannelTypeEnum;
import com.trhui.mallbook.enums.ServerCodeEnum;

/**
 * 支付订单汇总查询
 * @author huangyl
 * 
 */
public class QueryOrderSummaryClient extends AbstractClient {
    /**
     * 支付订单汇总查询--hf
     *
     * @param request
     * @return
     */
    public static BaseResponse<QueryOrderSummaryResponse> hfQuery(QueryOrderSummaryRequest request) {
        ApiRequest apiRequest = new ApiRequest.ApiRequestBuild()
                .merOrderId(request.getMerOrderId())
                .merchantNo(request.getMerchantNo())
                .params(request)
                .serverCode(ServerCodeEnum.QUERY_ORDER_SUMMARY)
                .channelType(ChannelTypeEnum.HF)
                .build();
        return post(apiRequest, QueryOrderSummaryResponse.class);
    }
    /**
     * 支付订单汇总查询--yb
     *
     * @param request
     * @return
     */
    public static BaseResponse<QueryOrderSummaryResponse> ybQuery(QueryOrderSummaryRequest request) {
        ApiRequest apiRequest = new ApiRequest.ApiRequestBuild()
                .merOrderId(request.getMerOrderId())
                .merchantNo(request.getMerchantNo())
                .params(request)
                .serverCode(ServerCodeEnum.QUERY_ORDER_SUMMARY)
                .channelType(ChannelTypeEnum.YB)
                .build();
        return post(apiRequest, QueryOrderSummaryResponse.class);
    }

}
